<%@ page language="java" contentType="text/html; charset=US-ASCII"
	pageEncoding="US-ASCII"%>
<%@ page import="java.sql.*"%>
<%@ page import="ca.radiologydb.util.Template"%>
<%@ page import="ca.radiologydb.util.ConnectionManager"%>

<!-- @author Nicholas Liu -->
<!-- Report search page. -->

<%
	Template template = new Template(this.getServletContext()
			.getRealPath("/").toString());
	out.println(template.getTemplateTop());
	out.println("<h3>Report Generator</h3>");
	// user access stuff. No username/notadmin = no access.
	if (session.getAttribute("username") == null
			|| session.getAttribute("usertype") == null) {
		out.println("Cannot display results as you're not logged in, or do not have the proper permissions.");
		out.println("<a href='login.jsp'>Login</a>");
	} else if (!session.getAttribute("usertype").equals("a")) {
		out.println("Cannot display results as you're not logged in, or do not have the proper permissions.");
		out.println("<a href='login.jsp'>Login</a>");

	} else {
		
		// print the form.
		out.println("<h3>Report Generation Module</h3>");

		out.println("<form method='GET' action='generate_report.jsp' id='report_parameters'>");

		out.println("<h4>Diagnosis Keywords:</h4>");
		out.println("<input type='text' name='diag' /><br />");
		out.println("<span class='help_text'>Search for only one diagnosis.</span>");

		out.println("<h4>Start Date</h4>");
		out.println("<input type='text' name='start_date' /><br />");
		out.println("<span class='help_text'>Must be in the format MM-DD-YYYY. Leave blank to not use in searching.</span><br />");

		out.println("<h4>End Date</h4>");
		out.println("<input type='text' name='end_date' /><br />");
		out.println("<span class='help_text'>Must be in the format MM-DD-YYYY. Leave blank to not use in searching.</span><br />");

		out.println("<input type='submit' name='Submit' value='Search Records' />");
		out.println("</form>");

		out.println(template.getTemplateBottom());
	}
%>




